package leecode

func trainingPlan(head *ListNode, cnt int) (result *ListNode) {
	//首先获取链表长度
	count := 0
	for i := head; i != nil; i = i.Next {
		count++
	}
	//倒数第i个,等于整数第count - i + 1个
	for i := 1; i <= count-cnt+1; i++ {
		result = head.Next
	}
	return result
}
